package biz.datalk.industrialland.admin.modules.system.pojo.dto;

import biz.datalk.industrialland.common.pojo.po.BasePO;
import biz.datalk.industrialland.common.validated.BatchDelete;
import biz.datalk.industrialland.common.validated.Delete;
import biz.datalk.industrialland.common.validated.Insert;
import biz.datalk.industrialland.common.validated.Update;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author tarofang@163.com
 * @date 2019-09-08
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class SysDepartDTO extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     * <p>
     * sys_depart.id
     */
    @EqualsAndHashCode.Include
    @NotNull(groups = {Update.class, Delete.class}, message = "{depart.no.exists.or.delete}")
    private Long id;

    /**
     * 父机构ID
     * <p>
     * sys_depart.pid
     */
    private Long pid;

    /**
     * 机构/部门名称
     * <p>
     * sys_depart.depart_name
     */
    @NotBlank(groups = {Insert.class, Update.class}, message = "{depart.departname.blank}")
    private String departName;

    /**
     * 英文名
     * <p>
     * sys_depart.depart_name_en
     */
    private String departNameEn;

    /**
     * 缩写,别称
     * <p>
     * sys_depart.depart_name_abbr
     */
    private String departNameAbbr;

    /**
     * 机构类型 1一级部门 2子部门
     * <p>
     * sys_depart.depart_type
     */
    @NotNull(groups = {Insert.class}, message = "{depart.departtype.null}")
    private Integer departType;

    /**
     * 机构编码
     * <p>
     * sys_depart.depart_code
     */
    //@Pattern(regexp = Regex.UNIQUE_CODE, message = "{depart.departcode.no.match.regex}")
    //@NotBlank(groups = {Insert.class, Update.class}, message = "{depart.departcode.blank}")
    private String departCode;

    /**
     * 部门级别
     * <p>
     * sys_depart.depart_level
     */
    private Integer departLevel;

    /**
     * 排序
     * <p>
     * sys_depart.depart_order
     */
    private Integer departOrder;

    /**
     * 描述
     * <p>
     * sys_depart.description
     */
    private String description;

    /**
     * 状态（Y启用，N不启用）
     * <p>
     * sys_depart.is_valid
     */
    private String isValid;

    /**
     * 删除状态（N-未删除 Y-已删除）
     * <p>
     * sys_depart.is_delete
     */
    private String isDelete;


    @NotBlank(groups = BatchDelete.class, message = "{depart.no.exists.or.delete}")
    private String sysids;
}
